package com.milk.system.model.vo;

import com.milk.system.model.entity.Products;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 商品信息表 分页VO
 *
 * @author milk
 * @since 2024-05-02
 */
@Schema(description = "商品信息表分页视图对象")
@NoArgsConstructor
@Data
public class ProductsPageVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "商品唯一标识")

    private Long id;

    @Schema(description = "商品名称")

    private String productName;

    @Schema(description = "商品图片")

    private String productImages;

    @Schema(description = "商品价格")

    private BigDecimal price;

    @Schema(description = "库存数量")

    private Integer stockQuantity;

    @Schema(description = "商家名称")
    private String merchantName;

    @Schema(description = "商品描述")

    private String description;

    @Schema(description = "商品类别")

    private String category;

    public ProductsPageVO(Products products) {
        this.id = products.getId();
        this.productName = products.getProductName();
        this.productImages = products.getProductImages();
        this.price = products.getPrice();
        this.stockQuantity = products.getStockQuantity();
        this.description = products.getDescription();
        this.category = products.getCategory();
    }
}
